using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using HengTong.Model.Db.System;
using TiaoTaoHelper.Wtm.Models;


namespace HengTong.ViewModel.Common.SysSealVms
{
    public partial class SysSealTemplateVm : BaseTemplateVM
    {
        [Display(Name = "印章名称")]
        public ExcelPropety SealNameExcel = ExcelPropety.CreateProperty<SysSeal>(x => x.SealName);
        [Display(Name = "印章编码")]
        public ExcelPropety SealCodeExcel = ExcelPropety.CreateProperty<SysSeal>(x => x.SealCode);
        [Display(Name = "所属组织")]
        public ExcelPropety OrgExcel = ExcelPropety.CreateProperty<SysSeal>(x => x.OrgId);
        [Display(Name = "所属用户组")]
        public ExcelPropety GroupExcel = ExcelPropety.CreateProperty<SysSeal>(x => x.GroupId);
        [Display(Name = "印章类型")]
        public ExcelPropety SealTypeExcel = ExcelPropety.CreateProperty<SysSeal>(x => x.SealType);
        [Display(Name = "印章图片")]
        public ExcelPropety SealImageExcel = ExcelPropety.CreateProperty<SysSeal>(x => x.SealImage);
        [Display(Name = "印章状态")]
        public ExcelPropety StatusExcel = ExcelPropety.CreateProperty<SysSeal>(x => x.Status);
        [Display(Name = "使用次数")]
        public ExcelPropety UseCountExcel = ExcelPropety.CreateProperty<SysSeal>(x => x.UseCount);
        [Display(Name = "最后使用时间")]
        public ExcelPropety LastUseTimeExcel = ExcelPropety.CreateProperty<SysSeal>(x => x.LastUseTime);
        [Display(Name = "备注信息")]
        public ExcelPropety RemarksExcel = ExcelPropety.CreateProperty<SysSeal>(x => x.Remarks);

	    protected override void InitVM()
        {
            OrgExcel.DataType = ColumnDataType.ComboBox;
            OrgExcel.ListItems = DC.Set<SysOrg>().GetSelectListItems(Wtm, y => y.Name);
            GroupExcel.DataType = ColumnDataType.ComboBox;
            GroupExcel.ListItems = DC.Set<SysGroup>().GetSelectListItems(Wtm, y => y.GroupName);
        }

    }

    public class SysSealImportVm : BaseImportVM<SysSealTemplateVm, SysSeal>
    {

    }

}
